package hyit.app.helper;

import java.sql.Date;
import java.sql.Time;

public class SeriesNumberHelper {
	public SeriesNumberHelper() {

	}

	@SuppressWarnings("deprecation")
	public static String CreateSeriesNumber(Date inputDate, Time inputTime,
			Integer teacherNumber, Integer sessionNumber) {
		String seriesNumber = null;
		int year = inputDate.getYear() % 100;
		int month = inputDate.getMonth() + 1;
		int day = inputDate.getDate();
		int hour = inputTime.getHours();
		int minute = inputTime.getMinutes();
		String monthTmp = "";
		String dateTmp = "";
		String hourTmp = "";
		String minuteTmp = "";
		if (month < 10) {
			monthTmp = "0";
		}
		if (day < 10) {
			dateTmp = "0";
		}
		if (hour < 10) {
			hourTmp = "0";
		}
		if (minute < 10) {
			minuteTmp = "0";
		}
		seriesNumber = year + monthTmp + month + dateTmp + day + hourTmp + hour
				+ minuteTmp + minute + teacherNumber + sessionNumber;
		return seriesNumber;
	}
}
